﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Algorithm.Easy_1791_FindCenter
{
    class MainProject
    {
        static void Main(string[] args)
        {
            int[][] array = new int[][]
            {
                new int[]{1,2 },
                new int[]{2,3 },
                new int[]{4,2 },
            };
            Console.WriteLine(FindCenter(array));
            //Console.WriteLine(IsPalindrome(1000021));
            Console.ReadKey();
        }
        public static int FindCenter(int[][] edges)
        {
            //1.获取两个对象相同的那个值
            HashSet<int> hash = new HashSet<int>(edges[0]);
            for (int i = 0; i < edges[1].Length; i++)
            {
                if (!hash.Add(edges[1][i]))
                {
                    return edges[1][i];
                }
            }
            return 0;
        }

    }
}
